package cn.lili.modules.payment.kit.dto.paypal;

import lombok.Data;

import java.util.List;

@Data
public class PurchaseUnits {

    private String reference_id;
    private Amount amount;
    private Payee payee;
    private String description;
    private String custom_id;
    private String invoice_id;
    private List<Items> items;
    private Shipping shipping;

    @Data
    private static class Shipping {
        private Name name;
        private Address address;

        @Data
        private static class Name {
            private String full_name;
        }

        @Data
        private static class Address {
            private String address_line_1;
            private String address_line_2;
            private String admin_area_1;
            private String admin_area_2;
            private String postal_code;
            private String country_code;
        }
    }

    @Data
    private static class Items {
        private String name;
        private UnitAmount unit_amount;
        private String quantity;

        @Data
        private static class UnitAmount {
            private String currency_code;
            private String value;
        }
    }

    @Data
    private static class Payee {
        private String email_address;
        private String merchant_id;
        private DisplayData displayData;

        @Data
        private static class DisplayData {
            private String brand_name;
        }
    }

    @Data
    private static class Amount {
        private String currency_code;
        private String value;
        private Breakdown breakdown;

        @Data
        private static class Breakdown {
            private ItemTotal item_total;
            private Shipping shipping;
            private Handling handling;
            private TaxTotal tax_total;
            private ShippingDiscount shipping_discount;

            @Data
            private static class ItemTotal {
                private String currency_code;
                private String value;
            }

            @Data
            private static class Shipping {
                private String currency_code;
                private String value;
            }

            @Data
            private static class Handling {
                private String currency_code;
                private String value;
            }

            @Data
            private static class TaxTotal {
                private String currency_code;
                private String value;
            }

            @Data
            private static class ShippingDiscount {
                private String currency_code;
                private String value;
            }
        }
    }
}
